package org.stvd.service.admin.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.stvd.core.dto.QueryResult;
import org.stvd.entities.admin.Loginfo;
import org.stvd.repository.admin.LoginfoDao;
import org.stvd.service.admin.LoginfoService;
import org.stvd.service.base.impl.BaseServiceImpl;

@Service("loginfoService")
public class LoginfoServiceImpl extends BaseServiceImpl<Loginfo> implements LoginfoService {

    @Resource(name = "LoginfoDao")
    private LoginfoDao loginfoDao;

    @Override
    public Loginfo findByPk(String logId) {
        return loginfoDao.findByPk(Loginfo.class, logId);
    }

    public QueryResult<Loginfo> getLoginfoResult(int start, int limit, String user_id, String role_id, String log_type,
        String log_type2, Date beginDate, Date endDate, String dep_id) {
        return loginfoDao.getLoginfoResult(start, limit, user_id, role_id, log_type, log_type2, beginDate, endDate, dep_id);
    }

    public boolean Emptyloginfo(String user_id, String log_type, Date beginDate, Date endDate, String dep_id) {
        return loginfoDao.Emptyloginfo(user_id, log_type, beginDate, endDate, dep_id);
    }

    @Override
    public QueryResult<Loginfo> getLoginfoResult(int start, int limit, 
        String username, String log_type, String log_type2, Date beginDate, Date endDate) {
        return loginfoDao.getLoginfoResult(start, limit, username, log_type, log_type2, beginDate, endDate);
    }
}